package cc.comac.mom.service.impl.config;

import cc.comac.mom.api.config.EquipDataConfigService;
import cc.comac.mom.bean.config.EquipDataConfigParamBean;
import cc.comac.mom.datahandlers.entity.config.EquipDataConfigDataHandler;
import cc.comac.mom.entity.config.EquipDataConfigEntity;
import cc.comac.mom.util.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Service
@RestController
public class EquipDataConfigServiceImpl implements EquipDataConfigService {

	@Autowired
	private EquipDataConfigDataHandler equipDataConfigDataHandler;
	@Override
	public ResultBean save(@RequestBody EquipDataConfigEntity obj) {
		return equipDataConfigDataHandler.saveDataConfig(obj);
	}

	@Override
	public ResultBean update(@RequestBody EquipDataConfigEntity obj) {
		return equipDataConfigDataHandler.updateDataConfig(obj);
	}

	@Override
	public ResultBean delete(@RequestBody EquipDataConfigEntity obj) {
		return equipDataConfigDataHandler.delete(obj);
	}

	@Override
	public ResultBean getById(@RequestBody EquipDataConfigEntity obj) {
		ResultBean resultBean = new ResultBean(true);
		resultBean.setObject(equipDataConfigDataHandler.getById(obj.getId()));
		return resultBean;

	}
	@Override
	public ResultBean selectByCondition(@RequestBody EquipDataConfigParamBean obj) {
		ResultBean resultBean = new ResultBean(true);
		resultBean.setObject( equipDataConfigDataHandler.selectBySomeFields(obj));
		return resultBean;
	}

}
